Repository navigation
fix(pm-stack): the console is the gate for the whole public hostname - #12412
Conversation
The exposure plan sent /console to the console and every other path straight to the dashboard, with Cloudflare Access as the only check in front of it. Three paths bypass Access (the install manifest, its icons, the Android asset links), and the dashboard resolves dot segments itself, so whether /icons/../attention reached the dashboard unsigned depended on how the edge normalises a path before it matches one. The dashboard has no sign-in of its own and accepts writes. The whole hostname now goes to the console. /console is served here. Every other path is passed to the dashboard only for a verified owner, using the parsed path that was checked. Five install files are public, matched exactly, read-only, with nothing the caller sent passed along. Writes from another site are refused before they reach the dashboard. Redirects, streamed answers and large bodies pass through. - config: PM_CONSOLE_DASHBOARD_URL (default http://127.0.0.1:4870); loopback http with no path, or empty to serve /console alone. - expose.py: one tunnel rule for the host, with no path, ahead of every other rule; an earlier two-rule layout is replaced. The Access application's cookie is SameSite=Lax and HttpOnly, and drift in either is put back. Tests: 32 bun tests and 7 Python tests. A seeded property sends 4,000 generated path spellings unsigned and checks the dashboard is asked only for one of five literal URLs. 26 planted faults in the gate and the route change are all caught. Run for real in front of a stand-in dashboard: passthrough, server-sent events, a 3 MB body, a redirect, 401 for unsigned dot-segment paths, 403 for a cross-site write, 502 when the dashboard is down. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
The workflow failed outright without signing secrets in the repository. The key stays on the pm-stack host instead: the workflow builds an unsigned APK and keeps it as an artifact, and sign.sh on the host signs it and checks the certificate against signing-fingerprint.txt. The password is read by apksigner from its file and is never an argument, an environment value or output. With the secrets set, the workflow still signs and publishes by itself. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
Why
The first plan for the public hostname sent
/consoleto the console and every other path straight to the dashboard, with Cloudflare Access as the only check in front of the dashboard. Three paths bypass Access so a phone can fetch them before sign-in. The dashboard resolves dot segments itself, so whether/icons/../attentioncould reach it unsigned depended on how the edge normalises a path before matching it. The dashboard has no sign-in of its own and it accepts writes. Nothing was exposed yet; this closes the gap before it is.What changes
/consoleis served there. Every other path is passed to the dashboard only for a verified owner, using the parsed path that was checked./manifest.webmanifestand four icons. They are matched exactly, read-only, and nothing the caller sent goes with the request.expose.pywrites one tunnel rule for the host, with no path, ahead of every other rule. The Access cookie isSameSite=LaxandHttpOnly.PM_CONSOLE_DASHBOARD_URL(defaulthttp://127.0.0.1:4870) must be loopback http with no path; empty serves/consolealone.Evidence
cd pm-stack/console && bun testpython3 -m unittest discover -s pm-stack/console/scripts -p 'test_*.py'/icons/../attention,/icons/%2e%2e/attentionand/icons/icon-192.png/../../attentionare 401; a cross-site write is 403; a stopped dashboard is 502Not exercised here: the real edge. That check follows deployment, with the route written last.
Undo
Revert this PR. The console then serves
/consoleonly, as in #12360.Refs #12360, #9077.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
/for verified owners, while/consolecontinues to serve the console. Selected install assets remain publicly accessible.